﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Input;

namespace Space
{
    public static class Extensions
    {
        public static float NextFloat(this Random rand)
        {
            return (float)rand.NextDouble();
        }
        public static T GetService<T>(this IServiceProvider myProvider) where T : class
        {
            return myProvider.GetService(typeof(T)) as T;
        }
        public static void RemoveAtInorder<T>(this List<T> list, int i)
        {
            if (i != list.Count - 1)
            {
                list[i] = list[list.Count - 1];
            }
            list.RemoveAt(list.Count - 1);
        }
        public static IEnumerable<T> Concat<T>(this IEnumerable<T> e, T value)
        {
            foreach (var cur in e)
            {
                yield return cur;
            }
            yield return value;
        }
    }
    class Math2
    {
        public static float Sin(float f)
        {
            return (float)Math.Sin(f);
        }
        public static float Cos(float f)
        {
            return (float)Math.Cos(f);
        }
    }
}
